<?php

/**
 * This is the model class for table "jumlahdayalistrikjenis".
 *
 * The followings are the available columns in table 'jumlahdayalistrikjenis':
 * @property integer $jdlj_id
 * @property string $jdlj_golongan
 * @property integer $jdlj_jumlah
 * @property integer $jdlj_pemakaian
 * @property integer $jdlj_tahun
 */
class Jumlahdayalistrikjenis extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Jumlahdayalistrikjenis the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'jumlahdayalistrikjenis';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('jdlj_jumlah, jdlj_pemakaian, jdlj_tahun', 'numerical', 'integerOnly'=>true),
			array('jdlj_golongan', 'length', 'max'=>128),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('jdlj_id, jdlj_golongan, jdlj_jumlah, jdlj_pemakaian, jdlj_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'jdlj_id' => 'Jdlj',
			'jdlj_golongan' => 'Golongan Tarif Pelanggan',
			'jdlj_jumlah' => 'Jumlah Daya yang Digunakan',
			'jdlj_pemakaian' => 'Pemakaian',
			'jdlj_tahun' => 'Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('jdlj_id',$this->jdlj_id);
		$criteria->compare('jdlj_golongan',$this->jdlj_golongan,true);
		$criteria->compare('jdlj_jumlah',$this->jdlj_jumlah);
		$criteria->compare('jdlj_pemakaian',$this->jdlj_pemakaian);
		$criteria->compare('jdlj_tahun',$this->jdlj_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}